﻿import com.dmotiko.mirador.*
import com.dmotiko.general.*
import mx.utils.Delegate;
import mx.video.*;

class MiradorRoomCapacidad
extends BaseClip {
		
	private var btnNuestrosSalones:Button;
	private var btnVideo:Button;
	private var btnGaleria:Button;
	private var mcHeader:MovieClip;
	
	private var mcPhotoClip:PhotoClip;
	private var mcInfo:MovieClip;
		
	private function initClip():Void {
		super.initClip();
			
		var root:MiradorRoomCapacidad = this;
		btnVideo.onRelease = function() {
			root.dispatchEvent( { target: root, type: BaseClipEvent.CHANGED, section: MiradorNuestrosSalones.VIDEO_FRAME } )
		}
		btnGaleria.onRelease = function() {
			root.dispatchEvent( { target: root, type: BaseClipEvent.CHANGED, section: MiradorNuestrosSalones.GALERIA_FRAME } )
		}
		btnNuestrosSalones.onRelease = function() {
			root.dispatchEvent( { target: root, type: BaseClipEvent.CHANGED, section: MiradorNuestrosSalones.HOME_FRAME } )
		}
		
	}
	
	public function childLoaded( evnt ):Void {
		if( evnt.target == mcPhotoClip ){
			mcPhotoClip.setData( data.capacity );
		} 
	}
	
	
	private function refreshData():Void {
		switch( data.name ) {
			case "danbro":
			mcHeader.gotoAndStop(1);
			mcInfo.gotoAndStop(1);
			break;
			
			case "mirador":
			mcHeader.gotoAndStop(2);
			mcInfo.gotoAndStop(2);
			break;
			
			case "altos":
			mcHeader.gotoAndStop(3);
			mcInfo.gotoAndStop(3);
			break;
		}
		
	}
	
}